package erik.util;

public interface Collection<T> extends Iterable<T>, java.io.Serializable{
	/**
	 * Return the number of items in this collection.
	 */
	int size();
	
	/**
	 * Tests if this collection is empty.
	 */
	boolean isEmpty();
	
	/**
	 * Tests if some item is in this collection.
	 */
	boolean contains(Object o);
	
	/**
	 * Adds an item to this collection.
	 */
	boolean add(T o);
	
	/**
	 * Removes an item from this collection.
	 */
	boolean remove(Object o);
	
	/**
	 * Removes all items from this collection, which is empty after this method is returns.
	 */
	void clear();
	
	/**
	 * Obtains an Iterator object used to traverse the collection.
	 */
	Iterator<T> iterator();
	
	/**
	 * Obtains a primitive array view of the collection.
	 */
	Object[] toArray();
	
	/**
	 * Obtains a primitive array view of the collection.
	 */
	<OtherT> OtherT[] toArray(OtherT[] arr);
}
